package com.example.nuc_ms_beta.ui.viewconstruction.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.example.nuc_ms_beta.R;
import com.example.nuc_ms_beta.app.MyApplication;
import com.example.nuc_ms_beta.bean.newest.Newest_ListView_New;
import com.yuyh.easyadapter.abslistview.EasyLVAdapter;
import com.yuyh.easyadapter.abslistview.EasyLVHolder;

import java.util.List;

/**
 * Created by bnhc on 17-5-21.
 */

public class NewestNewListViewAdapter extends EasyLVAdapter<Newest_ListView_New> {

    public NewestNewListViewAdapter(Context context, List list, int... layoutIds) {
        super(context, list, layoutIds);
    }

    public NewestNewListViewAdapter(Context context, List list) {
        super(context, list);
    }



    @Override
    public void convert(EasyLVHolder holder, int position, Newest_ListView_New newest_listView_new) {
        holder.setText(R.id.newestfragment_listview_item_title_tv, newest_listView_new.getListview_title());
        holder.setText(R.id.newestfragment_listview_item_content_tv,newest_listView_new.getListview_content_sm());
        Glide.with(MyApplication.context)
                .load(newest_listView_new.getListview_image().getUrl())
                .into((ImageView) holder.getView(R.id.newestfragment_listview_item_iv));
    }

}
